import Products.*
import kotlin.random.Random

abstract class AbstractProduct {
    abstract val shipmentDuration: Int
    abstract val weight: Double
    abstract val productCategory: ProductCategories
    var amount: Int = 1
}
class ListOfProducts(){
    var products:MutableList<AbstractProduct> = mutableListOf()
    init {
        products.add(Apple())
        products.add(BanquetService())
        products.add(Bed())
        products.add(Beef())
        products.add(Bowl())
        products.add(Bread())
        products.add(Byke())
        products.add(Cabinet())
        products.add(Cookie())
        products.add(DinnerService())
        products.add(DishWasher())
        products.add(Grinder())
        products.add(Jack())
        products.add(Jacket())
        products.add(Laptop())
        products.add(Mutton())
        products.add(Orange())
        products.add(Oven())
        products.add(Picture())
        products.add(Potato())
        products.add(PunchingBag())
        products.add(QuadBike())
        products.add(Refrigerator())
        products.add(Seat())
        products.add(Sofa())
        products.add(Speaker())
        products.add(Stove())
        products.add(Table())
        products.add(Tomato())
        products.add(Transmission())
        products.add(Tuxedo())
        products.add(WashingMachine())
    }
    fun getRandom():AbstractProduct{
        return products[Random.nextInt(0,products.size)]
    }
    fun getRandom(type:ProductCategories):AbstractProduct{
        var res: MutableList<AbstractProduct> = products.filter { it.productCategory == type }.toMutableList()
        return res[Random.nextInt(0,res.size)]
    }
}